<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:if test="hasActionErrors()">
	<span class="errors"><s:actionerror /></span>
</s:if>

<div id="rightPan">
	<div id="rightbodyPan">
		<div align="center"><p style=" font-size: 24px; padding: 10px 0 5px 0;" >ข้อมูลผู้ดูแลระบบ</p></div>
		<div id="headerTab">
			<a style="width: 70px;" href="<s:url action="admin_toAdd" namespace="/admin"/>">เพิ่มข้อมูล</a>
			<a style="width: 80px;" href="<s:url action="admin_get" namespace="/admin"/>">เรียกดูข้อมูล</a>
			<a style="width: 80px;" id="clicked">แก้ไขข้อมูล</a>
		</div>

		<script type="text/javascript">
			function ok(what) {
				if ( document.getElementById('button').value == "แก้ไข" )
				{
					document.getElementById('button').value = "ตกลง";
					document.getElementById('firstName').disabled = false;
					document.getElementById('lastName').disabled = false;
					document.getElementById('telephone').disabled = false;
				}
				else
				{
					document.getElementById( 'admin_edit' ).submit();
					
					document.getElementById('button').value = "แก้ไข";
					document.getElementById('firstName').disabled = true;
					document.getElementById('lastName').disabled = true;
					document.getElementById('telephone').disabled = true;
				}
			}			
		</script>

		<s:form id="admin_edit" action="admin_edit" theme="simple">
			<table>
				<tr>
					<td id="slabel" style="padding-top: 30px;">ชื่อ:</td>
					<td style="padding-top: 30px;"><s:textfield
							value="%{#session.ADMIN.firstName}" name="adminForm.firstName"
							size="25" id="firstName" disabled="true"></s:textfield></td>
				</tr>
				<tr>
					<td id="slabel">นามสกุล:</td>
					<td><s:textfield value="%{#session.ADMIN.lastName}"
							name="adminForm.lastName" size="25" id="lastName" disabled="true"></s:textfield>
					</td>
				</tr>
				<tr>
					<td id="slabel">เบอร์โทรศัพท์:</td>
					<td><s:textfield value="%{#session.ADMIN.telephone}"
							name="adminForm.telephone" size="25" id="telephone"
							disabled="true"></s:textfield></td>
				</tr>
			</table>

			<div align="center" style=" padding-top: 10px;">
				<input onclick="ok()" type="button" value="แก้ไข" id="button"></input>
			</div>
		</s:form>
	</div>
</div>


